'use strict';
var Schema = require('mongoose').Schema,
    Model = require('../../../Base/server/controllers/Model');

var modelField = {};
modelField.WorkLocation = {
    type: Schema.ObjectId,
    ref: 'WorkLocation',
    Name: '工位'
};

modelField.User = {
    type: Schema.ObjectId,
    ref: 'User',
    Name: '用户'
};

modelField.Terminal = {
    type: Schema.ObjectId,
    ref: 'Terminal',
    Name: '终端'
};

modelField.StartDateTime = {
    type: Date,
    Name: '开始时间'
};

modelField.EndDateTime = {
    type: Date,
    Name: '结束时间'
};

var newModel = new Model(modelField);
newModel.addIndex({User: 1, Terminal: 1});
newModel.addIndex({WorkLocation: 1, Terminal: 1});
newModel.create('StationUser', '用户上岗记录');
